﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class 删除表结构 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "TAgvInstructs");

            migrationBuilder.DropTable(
                name: "TCarriers");

            migrationBuilder.DropTable(
                name: "TCompanies");

            migrationBuilder.DropTable(
                name: "TMaterialExtData");

            migrationBuilder.DropTable(
                name: "TMaterialExtFields");

            migrationBuilder.DropTable(
                name: "TMaterialKeys");

            migrationBuilder.DropTable(
                name: "TMaterialPackages");

            migrationBuilder.DropTable(
                name: "TOwners");

            migrationBuilder.DropTable(
                name: "TReceivingBillDetails");

            migrationBuilder.DropTable(
                name: "TReceivingBills");

            migrationBuilder.DropTable(
                name: "TStations");

            migrationBuilder.DropColumn(
                name: "BatchNoExplain",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "LogicalPartCode",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "LogicalPartName",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "MakerialCategoryId",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "MakerialCategoryName",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "Mblnr",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "OutOrderNo",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "OwnerId",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "OwnerName",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "PurOrderLineNo",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "ReceivingBillDetailId",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "GrossWeight",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "GrossWeightUnitId",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "GrossWeightUnitName",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "HasSkuDetail",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "IsDismantle",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "IsNeedCharging",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "NetWeight",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "NetWeightUnitId",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "NetWeightUnitName",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "OwnerId",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "OwnerName",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "Volum",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "VolumUnitId",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "VolumUnitName",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "AreaId",
                table: "TInventoryLogs");

            migrationBuilder.DropColumn(
                name: "AreaName",
                table: "TInventoryLogs");

            migrationBuilder.DropColumn(
                name: "AreaCode",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "AreaId",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "AreaName",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "MaterialKeyId",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "OwnerId",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "OwnerName",
                table: "TInventories");

            migrationBuilder.RenameColumn(
                name: "ReceivingBillId",
                table: "TReceivingOrderDetails",
                newName: "MaterialCategoryId");

            migrationBuilder.RenameColumn(
                name: "PurOrderNo",
                table: "TReceivingOrderDetails",
                newName: "MaterialCategoryName");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "MaterialCategoryName",
                table: "TReceivingOrderDetails",
                newName: "PurOrderNo");

            migrationBuilder.RenameColumn(
                name: "MaterialCategoryId",
                table: "TReceivingOrderDetails",
                newName: "ReceivingBillId");

            migrationBuilder.AddColumn<string>(
                name: "BatchNoExplain",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "LogicalPartCode",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "LogicalPartName",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MakerialCategoryId",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MakerialCategoryName",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Mblnr",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "OutOrderNo",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "OwnerId",
                table: "TReceivingOrderDetails",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "OwnerName",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PurOrderLineNo",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "ReceivingBillDetailId",
                table: "TReceivingOrderDetails",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "GrossWeight",
                table: "TMaterials",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "GrossWeightUnitId",
                table: "TMaterials",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "GrossWeightUnitName",
                table: "TMaterials",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "HasSkuDetail",
                table: "TMaterials",
                type: "bit",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "IsDismantle",
                table: "TMaterials",
                type: "bit",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "IsNeedCharging",
                table: "TMaterials",
                type: "bit",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "NetWeight",
                table: "TMaterials",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "NetWeightUnitId",
                table: "TMaterials",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "NetWeightUnitName",
                table: "TMaterials",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "OwnerId",
                table: "TMaterials",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "OwnerName",
                table: "TMaterials",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Volum",
                table: "TMaterials",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "VolumUnitId",
                table: "TMaterials",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "VolumUnitName",
                table: "TMaterials",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "AreaId",
                table: "TInventoryLogs",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "AreaName",
                table: "TInventoryLogs",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "AreaCode",
                table: "TInventories",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "AreaId",
                table: "TInventories",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "AreaName",
                table: "TInventories",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "MaterialKeyId",
                table: "TInventories",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "OwnerId",
                table: "TInventories",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "OwnerName",
                table: "TInventories",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.CreateTable(
                name: "TAgvInstructs",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RequestId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RequestUrl = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RequstBody = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RequstType = table.Column<int>(type: "int", nullable: true),
                    Respone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RetryTimes = table.Column<int>(type: "int", nullable: true),
                    Success = table.Column<bool>(type: "bit", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TAgvInstructs", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TCarriers",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    AddrDetail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contact1 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contact1Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContactMobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Fax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeId = table.Column<int>(type: "int", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TCarriers", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TCompanies",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    AddrDetail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContactMobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Tel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeId = table.Column<int>(type: "int", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TCompanies", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialExtData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BindDictTypeId = table.Column<int>(type: "int", nullable: true),
                    ControlType = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    FieldCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FieldData = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FieldId = table.Column<int>(type: "int", nullable: false),
                    FieldName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FieldValues = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InputWay = table.Column<int>(type: "int", nullable: true),
                    IsTree = table.Column<bool>(type: "bit", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: false),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialExtData", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialExtFields",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BindDictTypeId = table.Column<int>(type: "int", nullable: true),
                    BindDictTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ControlType = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    FieldCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FieldName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FullTypeIds = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FullTypeNames = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InputValues = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InputWay = table.Column<int>(type: "int", nullable: true),
                    IsRequired = table.Column<bool>(type: "bit", nullable: true),
                    IsTree = table.Column<bool>(type: "bit", nullable: false),
                    TypeId = table.Column<int>(type: "int", nullable: false),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialExtFields", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialKeys",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeptCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeptName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Mblnr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Mjahr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    OutOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProduceFactory = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PurOrderLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true),
                    PurOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qadate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    QualityState = table.Column<int>(type: "int", nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Zeile = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialKeys", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TMaterialPackages",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BaseUnitId = table.Column<int>(type: "int", nullable: true),
                    BaseUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConversionFactor = table.Column<int>(type: "int", nullable: true),
                    EquipType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    EquipTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FactorBu = table.Column<int>(type: "int", nullable: true),
                    Height = table.Column<int>(type: "int", nullable: true),
                    Length = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: false),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackageLevel = table.Column<int>(type: "int", nullable: true),
                    PackageUnitId = table.Column<int>(type: "int", nullable: true),
                    PackageUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubPackageUnitId = table.Column<int>(type: "int", nullable: true),
                    SubPackageUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Uomqty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Volumn = table.Column<int>(type: "int", nullable: true),
                    Weight = table.Column<int>(type: "int", nullable: true),
                    Width = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TMaterialPackages", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TOwners",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    AddrDetail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contacts = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MobilePhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    ZipCode = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TOwners", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TReceivingBillDetails",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BatchNoExplain = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BillId = table.Column<int>(type: "int", nullable: false),
                    BillLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BillNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CheckedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ConfirmDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsNeedQc = table.Column<bool>(type: "bit", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialTypeCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    NeedCheckQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Price = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ProduceFactory = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PurchaseOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    ReceivedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: false),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TReceivingBillDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TReceivingBills",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BeginDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    BillNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CheckResult = table.Column<int>(type: "int", nullable: true),
                    CheckType = table.Column<int>(type: "int", nullable: true),
                    CheckedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    EndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsCreatedChecklist = table.Column<bool>(type: "bit", nullable: true),
                    Ngreason = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Receiver = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RefSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    StoLocation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TotalCheckQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    TotalQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TReceivingBills", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TStations",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    AddrFloor = table.Column<int>(type: "int", nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeviceCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    FunctionType = table.Column<int>(type: "int", nullable: false),
                    IsLock = table.Column<bool>(type: "bit", nullable: true),
                    Ledid = table.Column<int>(type: "int", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StationSort = table.Column<int>(type: "int", nullable: false),
                    StationType = table.Column<int>(type: "int", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: false),
                    WhCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: false),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TStations", x => x.Id);
                });
        }
    }
}
